Skip to content

feat(core,cli): M3c-rest — auto classifier mode + /init multi-phase#28

Merged
oratis merged 1 commit into
mainfrom
feat/auto-mode-and-init
May 28, 2026
Merged

feat(core,cli): M3c-rest — auto classifier mode + /init multi-phase#28
oratis merged 1 commit into
mainfrom
feat/auto-mode-and-init

Conversation

@oratis

@oratis oratis commented May 28, 2026

Copy link
Copy Markdown
Owner

Auto mode: static deny/allow/soft_deny first; LLM classifier (8 tokens, t=0) decides; fallback 'ask' default. Wired into dispatchToolCall + agent.ts + REPL/headless. /init now actually scans project, asks provider for AGENTS.md draft, prompts for approval. 8 new tests; 448 passing.

  · packages/core/src/auto-mode/index.ts (NEW, ~115 lines)
    - classifyAutoMode({ toolName, toolInput, config, provider })
    - Static order: hard_deny → allow → soft_deny → LLM classifier
    - LLM call: tiny prompt + 8 tokens max + temperature=0; parses
      "allow"/"deny"/anything-else→"ask". Falls back to config.fallback
      (default 'ask') when no provider.

  · packages/core/src/harness/tool-dispatcher.ts
    - DispatchRequest gains autoMode + autoModeProvider.
    - When mode === 'auto' AND no static rule matched, classifier verdict
      drives decision (allow/deny/ask) before the hook chain.

  · packages/core/src/agent.ts
    - RunAgentOptions.autoMode passed through; classifier uses the agent's
      provider (no extra config needed in the simple case).

  · apps/cli/src/commands.ts + repl.ts
    - /init now invokes ctx.initFlow (REPL-only).
    - runInitFlow(): scan (top-level + package.json/README/etc) →
      provider.runTurn drafts AGENTS.md → show first 40 lines → ask y/n →
      write to <cwd>/AGENTS.md.

Tests: core 393 → 401 (+8: classifyAutoMode unit); cli 47 unchanged.
Total 440 → 448 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit b4a344a into main May 28, 2026
@oratis oratis deleted the feat/auto-mode-and-init branch May 28, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant